<script>
$(document).ready(function() { 


        
<?=$this->hide_header?>
            
    
  
//$("a.cambiar").click(function () {
$('.conf').on("click", "a.cambiar", function(e){      
    var textara=$('#textarea').val('')
    var id=this.id
    
    var aux=id.split('-');
    var orignal_id=aux[1];
    var accion=aux[2]

    var idli= $(this).closest('li').attr('id');

    
    $('#dialog').html(textara)
    .dialog({buttons: {
        "Cancelar": function() {
            $('#dialog').dialog('close');
        },
        "Continuar": function() {
           var notas=$('#textarea').val()
          
           $.post('/comite-cambios/aceptacion',{id:id,notas:notas},function(data){            
                
                    if(accion=='SI')
                    {
                        $('#'+idli).addClass('aceptado').removeClass('denegado')
                        $('#'+idli+' .button_aceptar ').hide()
                        $('#'+idli+' .button_rechazar ').show()
                    } else {
                        $('#'+idli).addClass('denegado').removeClass('aceptado')
                        $('#'+idli+' .button_rechazar').hide()
                        $('#'+idli+' .button_aceptar ').show()
                    } 
                    
                    $('#dialog').dialog('close');   
                    


           })
        }
    }
    })
    .dialog('open').dialog({'title':'Comentarios'});;

})  
    
  
$("#header,#texto_msg,#cometchat_base").hide();
$('body').css('text-size','0.4em');              
        
});


</script>

<style>


table.calendar {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0px;
	table-layout: fixed;
}

table.calendar caption {
  font-size: 2.6em;
  color: #000000;
  background-color: #FFFFFF;
  padding: 2px;
  font-weight: bolder;
}

table.calendar thead th {
  background-color: #C3D9FF;
  border: 1px solid #C3D9FF;
  color: #000000;
  font-size: 1.4em;
  padding: .5em;
  text-align: center;
}




table.calendar tbody td {
	border:1px solid #C3D9FF;
	background-color:#FFFFFF;
	color:#444444;
	padding:0px;
	margin:0px;
	vertical-align: top; 
	height:80px;
    
}

table.calendar tbody td.finde {
	background-color:#FFF0F0;
}

table.calendar tbody td.today {
	background-color:#FFFFCE;
}

table.calendar tbody td.today div.dia{
	background-color:#BDCFDE;
}




.dia {
	background-color:#E8EEF7;
	color:#555555;
	line-height:16px;
	overflow:hidden;
	padding-right:2px;
	text-align:center;
	font-weight:bolder;
	font-size: 12pt;
}

.dia:hover {
    background-color:#C3D9FF;
	color:#ff0000;
	cursor: pointer;
}


.conf{float:left;width:100%;height:13px;}




.boton{
    margin:1px;
    padding:1px;
    float: left;
    height:11px
}

table.calendar ul {
  margin: 0px;
  padding: 0;
  list-style-type: none;
}

table.calendar li {
	
  	font-size: 1.0em;
  	font-weight: normal;
  	padding: 5px;
  	margin: 5px;
	color:#444444;
	line-height:12px;
	overflow:hidden;
	padding-right:1px;
	text-align:left;
	border-radius:2px;
	-moz-border-radius:2px;
    box-shadow: 0 3px 5px #666666;
    
}


.finde{
    width:12%
}

table.calendar li.aceptado{
   padding: 2px;
   /*border:3px solid #00FF00; */
   background-color:#00FF00;

}
table.calendar li.denegado{
   padding: 2px;
   /*border:3px solid #FF0000; */
   background-color:#FF0000;
   text-decoration:line-through;
}


.i099{
	border: 1px solid #C3D9FF;
	background-color:#FFFFFF;
}


.jTip  {
  	display:block;
	color:#444444;
}


table.calendar thead {display: table-row-group}


.button_aceptar{
     border:1px solid #C0C0C0; 
     padding:0px;
     margin: 0;
     background-color:green;
     color:white;
     cursor:pointer;
}
.button_rechazar{
     border:1px solid #C0C0C0; 
     margin: 0;
     padding: 0;
     background-color:red;
     color:white;
     cursor:pointer;
}
.button_aceptar:hover,.button_rechazar:hover{
    color:white;
    cursor:pointer;
}

.aceptar{
   width:160px;
   padding: 5px;
   margin:5px;
   border:3px solid #00FF00; 
    background-color:#00FF00;

}
.rechazar{
    width:160px;
   padding: 5px;
   margin:5px;
   border:3px solid #FF0000; 
    background-color:#FF0000;
   text-decoration:line-through;

}

.pendiente{

   width:160px;
   padding: 5px;
   margin:5px;
   border:3px solid #C0C0C0; 
}


/*
table.calendar li.d , .t{border:3px solid  aqua}
table.calendar li.d1, .t1{-moz-opacity:0.5;border:3px solid blue;}
table.calendar li.d2, .t2{-moz-opacity:0.4;border:3px solid yellow}
table.calendar li.d3, .t3{-moz-opacity:0.6;border:3px solid maroon}
table.calendar li.d4, .t4{-moz-opacity:0.8;border:3px solid black}
table.calendar li.d6, .t6{-moz-opacity:0.2;border:3px solid fuchsia}
*/

</style>






<div style="clear:both"></div>
<div id="texto_msg">
    <?if(!$this->hide_header) print $this->msg("Intervenciones Pendientes aprobar Comite de Cambio");?><br />
</div>
<div>
<span class="aceptar ui-corner-all">Intervención Aceptada</span>
<span class="rechazar ui-corner-all">Intervención Rechazada</span>
<span class="pendiente ui-corner-all">Intervención Pendiente Aprobar</span>
</div>
<?=$this->msg('Solo se muestran intervenciones de los próximos 25 días','atencion')?>

<?foreach($this->calendario as $v){
    print $this->calendar($v['fecha'],$v['data']);
}?>


<div style="display: none;">
<textarea cols="60" rows="5" id="textarea"></textarea>
</div>

